package com.monitor.system.service.impl;

import java.util.List;
import com.monitor.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.monitor.system.mapper.SoftwareDeviceMapper;
import com.monitor.system.domain.SoftwareDevice;
import com.monitor.system.service.ISoftwareDeviceService;

/**
 * 软件设备Service业务层处理
 * 
 * @author monitor
 * @date 2024-06-13
 */
@Service
public class SoftwareDeviceServiceImpl implements ISoftwareDeviceService 
{
    @Autowired
    private SoftwareDeviceMapper softwareDeviceMapper;

    /**
     * 查询软件设备
     * 
     * @param id 软件设备主键
     * @return 软件设备
     */
    @Override
    public SoftwareDevice selectSoftwareDeviceById(Long id)
    {
        return softwareDeviceMapper.selectSoftwareDeviceById(id);
    }

    /**
     * 查询软件设备列表
     * 
     * @param softwareDevice 软件设备
     * @return 软件设备
     */
    @Override
    public List<SoftwareDevice> selectSoftwareDeviceList(SoftwareDevice softwareDevice)
    {
        return softwareDeviceMapper.selectSoftwareDeviceList(softwareDevice);
    }

    /**
     * 新增软件设备
     * 
     * @param softwareDevice 软件设备
     * @return 结果
     */
    @Override
    public int insertSoftwareDevice(SoftwareDevice softwareDevice)
    {
        softwareDevice.setCreateTime(DateUtils.getNowDate());
        return softwareDeviceMapper.insertSoftwareDevice(softwareDevice);
    }

    /**
     * 修改软件设备
     * 
     * @param softwareDevice 软件设备
     * @return 结果
     */
    @Override
    public int updateSoftwareDevice(SoftwareDevice softwareDevice)
    {
        softwareDevice.setUpdateTime(DateUtils.getNowDate());
        return softwareDeviceMapper.updateSoftwareDevice(softwareDevice);
    }

    /**
     * 批量删除软件设备
     * 
     * @param ids 需要删除的软件设备主键
     * @return 结果
     */
    @Override
    public int deleteSoftwareDeviceByIds(Long[] ids)
    {
        return softwareDeviceMapper.deleteSoftwareDeviceByIds(ids);
    }

    /**
     * 删除软件设备信息
     * 
     * @param id 软件设备主键
     * @return 结果
     */
    @Override
    public int deleteSoftwareDeviceById(Long id)
    {
        return softwareDeviceMapper.deleteSoftwareDeviceById(id);
    }
}
